#!/bin/bash

# Let runit capture all script error messages
exec 2>&1

exec chpst -e <%= @options[:env_directory] %> -P \
  -u <%= @options[:user] %>:<%= @options[:groupname] %> \
  -U <%= @options[:user] %>:<%= @options[:groupname] %> \
  /opt/gitlab/embedded/bin/python3 <%=@options[:preprocessor_dir] %>/preprocess.py \
    --tokenizer-pickle-path <%=@options[:preprocessor_dir] %>/tokenizer.pickle \
    --log-dir <%= @options[:log_directory] %> \
    --socket-dir <%= @options[:sockets_dir] %>
